/**
 * @author none
 *
 */
class P100NNPlayerView extends V.PlayerView
{
    public userInfo: eui.Group;
    public head: eui.Image;
    public headkuang: eui.Image;
    public userInfoBg: eui.Image;
    public nickNameLabel: eui.Label;
    public moneyLabel: eui.Label;
    public bankerIcon: eui.Image;
    public gameEffectPanel: NNGameEffectPanel;//特效面板
    public bankerAnimationImg: eui.Image;
    public bankerAnimation: how.Animation;


    public init():void
    {
        this.start();
    }

    public start(): void
    {
        this.head.mask = this.headkuang;
        this.bankerAnimation.visible = false;
    }

    public showP100NNUser(): void
    {
        var data = D.App.userData;
        this.showPlayerInfoPanel();
        this.nickNameLabel.text = this.isMe() ? base.Utils.formatNickName(data.nickName, 10) : data.nickName;
        this.head.source = data.gender == 1 ? "man" + data.faceID + "_png" : "women" + data.faceID + "_png";
        this.moneyLabel.text = base.Utils.formatCurrency(data.score);
        this.bankerIcon.visible = false;
        this.bankerAnimation.visible = false;
        this.userInfoBg.visible = true;
        this.bankerAnimationImg.visible = false;
    }

    public onDestroy(): void 
    {
    }

    //设置离开UI（包括起立、旁观、离开）
    public setLeaveUI(): void 
    {
        this.hidePlayerInfoPanel();
    }

    //设置玩家身上的金币数
    public showPlayerMoney(money): void 
    {
        this.moneyLabel.text = base.Utils.formatCurrency(money);
    }
    
    //隐藏用户信息
    public hidePlayerInfoPanel(): void 
    {
        this.userInfo.visible = false;
        this.bankerIcon.visible = false;
        this.userInfoBg.visible = false;
    }

    //显示用户信息
    public showPlayerInfoPanel(): void 
    {
        this.userInfo.visible = true;
        this.bankerIcon.visible = true;
        this.userInfoBg.visible = true;
    }
    
    //播放庄家动画
    public playBankerEffect() 
    {
        this.bankerAnimation.visible = true;
        this.bankerAnimation.play();
        this.bankerIcon.visible = false;
    }
}